home *** CD-ROM | disk | FTP | other *** search
/ Amoszine PD Edition 0 / Amoszine PD Edition 0.adf / SOURCE_CODE / Bounding_Box.Amos / Bounding_Box.amosSourceCode < prev    next >
AMOS Source Code  |  1993-02-25  |  1KB  |  57 lines

  1. Rem CrossHairs 
  2. '
  3. ' click left mouse button
  4. ' use mouse to draw bounding box 
  5. ' click left mouse button again to end   
  6.  
  7. Flash Off : Curs Off : Hide : Cls 0
  8. Set Line %1111000011110000
  9. Gr Writing 0
  10.  
  11. Repeat 
  12.    
  13.    If Key State(69) Then QUIT
  14.    
  15.    X=X Screen(X Mouse) : Y=Y Screen(Y Mouse)
  16.    
  17.    If OLDX<>X or OLDY<>Y
  18.       Bob 1,0,Y,1
  19.       Bob 2,X,0,2
  20.       OLDX=X : OLDY=Y
  21.    End If 
  22.    
  23.    If Mouse Key=1 and S=0 and X<>X2 and Y<>Y2
  24.       X1=X : Y1=Y
  25.       S=1
  26.    End If 
  27.    
  28.    If Mouse Key=1 and S>0 and X<>X1 and Y<>Y1
  29.       X2=X : Y2=Y
  30.       Bob Off : Wait Vbl 
  31.       Ink 0 : Box X1,Y1 To XT,YT
  32.       Ink 2 : Box X1,Y1 To X2,Y2
  33.       S=0 : E=1
  34.    End If 
  35.    
  36.    If S>0 and X<>XT and Y<>YT
  37.       Bob Off : Wait Vbl 
  38.       Ink 0 : Box X1,Y1 To XT,YT
  39.       Bob Off : Wait Vbl 
  40.       Ink 2 : Box X1,Y1 To X,Y
  41.       XT=X : YT=Y
  42.    End If 
  43.    
  44.    Multi Wait 
  45.    
  46. Until E>0 and Mouse Key
  47.  
  48. Cls 0 : Paper 0 : Print "Coordinates are: ";Str$(X1)-Chr$(32);",";Str$(Y1)-Chr$(32);" and ";Str$(X)-Chr$(32);",";Str$(Y)-Chr$(32)
  49.  
  50. Wait 150 : QUIT
  51.  
  52. Procedure QUIT
  53.    
  54.    Default 
  55.    Edit 
  56.    
  57. End Proc